from django.db import models

class ClassroomuseinfoIf(models.Model):
    use_id = models.IntegerField(primary_key=True)
    building_id = models.IntegerField()
    cid = models.IntegerField()
    week = models.IntegerField()
    day = models.IntegerField()
    time = models.IntegerField()
    state = models.IntegerField()
    remark = models.CharField(max_length=255, blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'classroomuseinfo_if'


class ClassroomuseinfoJidian(models.Model):
    use_id = models.IntegerField(primary_key=True)
    building_id = models.IntegerField()
    cid = models.IntegerField()
    week = models.IntegerField()
    day = models.IntegerField()
    time = models.IntegerField()
    state = models.IntegerField()
    remark = models.CharField(max_length=255, blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'classroomuseinfo_jidian'


class ClassroomuseinfoJingguan(models.Model):
    use_id = models.IntegerField(primary_key=True)
    building_id = models.IntegerField()
    cid = models.IntegerField()
    week = models.IntegerField()
    day = models.IntegerField()
    time = models.IntegerField()
    state = models.IntegerField()
    remark = models.CharField(max_length=255, blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'classroomuseinfo_jingguan'


class ClassroomuseinfoWaiyu(models.Model):
    use_id = models.IntegerField(primary_key=True)
    building_id = models.IntegerField()
    cid = models.IntegerField()
    week = models.IntegerField()
    day = models.IntegerField()
    time = models.IntegerField()
    state = models.IntegerField()
    remark = models.CharField(max_length=255, blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'classroomuseinfo_waiyu'


class Classroombasicinfo(models.Model):
    cid = models.IntegerField(primary_key=True)
    classroom_name = models.IntegerField()
    capacity = models.IntegerField()
    notice = models.IntegerField(blank=True, null=True)
    attribute = models.CharField(max_length=45)
    building_id = models.IntegerField()

    class Meta:
        managed = True
        db_table = 'classroombasicinfo'

class Reserve(models.Model):
    reserve_id = models.AutoField(primary_key=True)
    week = models.IntegerField()
    day = models.IntegerField()
    time = models.IntegerField()
    classroom_id = models.IntegerField()
    # 0表示申请预约，1表示同意预约，2表示驳回预约
    state = models.IntegerField()
    user_id = models.IntegerField()
    building_id = models.IntegerField()
    remark = models.CharField(max_length=255, blank=True, null=True)
    class Meta:
        managed = False
        db_table = 'reserve'
    

class User(models.Model):
    uid = models.IntegerField(primary_key=True)
    state = models.IntegerField()
    name = models.CharField(max_length=20)
    sid = models.CharField(max_length=45)
    pwd = models.CharField(max_length=45)
    college = models.IntegerField(blank=True, null=True)
    # Field renamed because it ended with '_'.
    class_field = models.IntegerField(
        db_column='class_', blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'user'
